﻿<form action="index.php" method="post" >
<table>
	<tr style="border:1px solid silver">
		<td colspan="4" style="background:silver;"><h4><?php echo (isset($this->item->id)?'Cập nhật thuộc tính kỹ thuật':'Thêm thuộc tính kỹ thuật') ?></h4></td>
	</tr>
	<tr style="border:1px solid silver">
		<td>Tên thuộc tính</td>
		<td>
			<input type="text" style="width:260px;" name="name" value="<?php echo @$this->item->name ?>" />		
		</td>
		<td>Danh mục</td>
		<td>
			<select name="catid" >
			<option value="0" >Không biết</option>
			<?php foreach($this->cat as $cat){ ?>
				<?php if(@$cat->id==@$this->item->catid){ ?>
					<option value="<?php echo $cat->id ?>" selected><?php echo $cat->name ?></option>
				<?php }else{ ?>
					<option value="<?php echo $cat->id ?>"><?php echo $cat->name ?></option>
			<?php }}?>	
			</select>		
		</td>
	</tr>
	<tr>
		<td>
			<input type="submit" value="Save" />
			<input type="button" onclick="document.location.href='index.php?c=product&t=attri';" value="Close" />
		</td>
	</tr>
</table>
<input type="hidden" name="c" value="product" />
<input type="hidden" name="t" value="proccessaddattri" />
<input type="hidden" name="id" value="<?php echo @(int)$this->item->id ?>" />
</form>
<script >
	function checkvalid()
	{
		if(document.addFrom.name.value=='')
			alert('Vui lòng nhập tên !');
		else
			document.addFrom.submit();
	}
</script>